{% extends "base_generic.html" %}

{% block content %}
    <h1>Renew: {{ book_instance.book.title }}</h1>
    <p>Borrower: {{ book_instance.borrower }}</p>
    <p{% if book_instance.is_overdue %} class="text-danger"{% endif %}>Due date: {{ book_instance.due_back }}</p>
    
    <form action="" method="post">
        {% csrf_token %}
        <div class="form-group">
            {{ form.renewal_date.label_tag }}
            {{ form.renewal_date }}
            {% if form.renewal_date.errors %}
                <div class="alert alert-danger">
                    {{ form.renewal_date.errors }}
                </div>
            {% endif %}
        </div>
        <button type="submit" class="btn btn-primary">Renew</button>
    </form>
{% endblock %}
